#[derive(Debug)]
pub struct Account {
  pub id: i32,
  pub name: String,
}

use sqlx::{FromRow, Row};
impl FromRow<'_, sqlx::postgres::PgRow> for Account {
  fn from_row(row: &'_ sqlx::postgres::PgRow) -> Result<Self, sqlx::Error> {
    Ok(Account {
      id: row.try_get(0).unwrap_or(0),
      name: row.try_get(1).unwrap_or(Default::default()),
    })
  }
}
